#include "mycomponent.h"
#include "mycomponentplugin.h"

#include <QtPlugin>

MyComponentPlugin::MyComponentPlugin(QObject *parent)
    : QObject(parent)
{
    m_initialized = false;
}

void MyComponentPlugin::initialize(QDesignerFormEditorInterface * /* core */)
{
    if (m_initialized)
        return;

    // Add extension registrations, etc. here

    m_initialized = true;
}

bool MyComponentPlugin::isInitialized() const
{
    return m_initialized;
}

QWidget *MyComponentPlugin::createWidget(QWidget *parent)
{
    return new MyComponent(parent);
}

QString MyComponentPlugin::name() const
{
    return QLatin1String("MyComponent");
}

QString MyComponentPlugin::group() const
{
    return QLatin1String("MyGroup");
}

QIcon MyComponentPlugin::icon() const
{
    return QIcon(QLatin1String(":/app.png"));
}

QString MyComponentPlugin::toolTip() const
{
    return QLatin1String("");
}

QString MyComponentPlugin::whatsThis() const
{
    return QLatin1String("");
}

bool MyComponentPlugin::isContainer() const
{
    return false;
}

QString MyComponentPlugin::domXml() const
{
    return QLatin1String("<widget class=\"MyComponent\" name=\"myComponent\">\n</widget>\n");
}

QString MyComponentPlugin::includeFile() const
{
    return QLatin1String("mycomponent.h");
}
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2(mycomponentplugin, MyComponentPlugin)
#endif // QT_VERSION < 0x050000
